{include file="public/head" /}
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">后台用户管理</a>
            <a>
              <cite>操作日志</cite></a>
          </span>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input"  autocomplete="off" placeholder="开始日"
                                   name="start" id="start" value="{$search.start?$search.start:''}">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input"  autocomplete="off" placeholder="截止日"
                                   name="end" id="end" value="{$search.end?$search.end:''}">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="name"  placeholder="操作用户" autocomplete="off"
                                   class="layui-input name" value="{$search.name?$search.name:''}" >
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach">
                                <i class="layui-icon">&#xe615;</i>
                            </button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form" id="pagetab">
                        <thead>
                        <tr>
                            <th>操作名称</th>
                            <th>操作用户</th>
                            <th>操作方法</th>
                            <th>操作时间</th>
                        </thead>
                        <tbody>
                        {volist name="res" id="v"}
                        <tr>
                            <td>{$v.log_name}</td>
                            <td>{$v.name}</td>
                            <td>{$v.type}</td>
                            <td>{:date('Y-m-d H:i:s', $v['createtime'])}</td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page" id="page"></div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate', 'form', 'laypage'], function(){
        var laydate = layui.laydate;
        var laypage = layui.laypage;
        var form = layui.form;
        var url = '{:url("../AdminLog/index")}'+'?{$query}';

        //执行一个laydate实例
        laydate.render({
            elem: '#start',//指定元素
            type: "datetime",
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end', //指定元素
            type: "datetime",
        });

        //执行一个laypage实例
        laypage.render({
            elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
            ,count:'{$count}'//数据总数，从服务端得到
            ,limit :'{$pageTotal}'
            ,curr:'{$curr}'
            ,jump: function(obj, first){
                if(!first){ //一定要加此判断，否则初始时会无限刷新
                    location.href = url+'&page='+obj.curr;
                }
            }
        });
    });


</script>
</html>
